package com.attilax.office;

import java.io.PrintStream;

import com.attilax.cmd.CmdX;
import com.attilax.log.StdOutErrRedirector4slf4j;
import com.attilax.text.ParamUtil;

public class OfficeCliApi4php {

	public static void main(String[] args) {
	// System.out.println("--startr66");
		PrintStream out_ori=System.out;
	   	StdOutErrRedirector4slf4j.redirectSystemOutAndErrToLog_slf4j();
		String filepath = args[0];
		String type_id = args[1];
		String cmd = "office_page_cli.bat @f@  " + type_id;
		cmd = cmd.replace("@f@", filepath);

		String ret_from_cli_console = CmdX.exe(cmd);
		String page_frm_parse_console_ret_int = "";
		System.setOut(out_ori);
	//	System.out.println("--");
		try {
			page_frm_parse_console_ret_int = ParamUtil.getParam(ret_from_cli_console);
		} catch (Exception e2) {
			System.out.println(e2.getMessage());
			return;
		}

		try {
			System.out.println("{{{" + page_frm_parse_console_ret_int + "}}}");
		} catch (Exception e) {
			System.out.println(e.getMessage());

		}
	}

}
